#include "intc.h"
#include <stdio.h>

//process_handle event_cb[EVENT_NUM];
//
////load irq function
//void intc_irq_register(intc_event_e e, process_handle cb)
//{
//    event_cb[e] = cb;
//}
//
//void intc_irq_unregister(intc_event_e e)
//{
//    event_cb[e] = NULL;
//}
//
//uint32_t intc_get_irq_status(void)
//{
//    uint32_t status = 0;
//    status = ((hal_nfc_get_register(8, 0x3e, 1) >> 6) << PICC_ACTIVE_EVENT);
//    status |= ((hal_nfc_get_register(8, 0x3b, 0) >> 6) << PICC_FIELD_IN_EVENT);
//    status |= hal_nfc_get_register(0, 0x4, 0);
//    hal_nfc_set_register(0, 0x04, 0x7f, 0);
//    return status;
//}
//
////void intc_irq_handler(void)
////{
//////    do {
//////       // EXTI_ClearITPendingBit(EXIT_LINE_NUM);
//////       // NVIC_ClearPendingIRQ(EXIT_IRQ_NUM);
//////        uint32_t status = intc_get_irq_status();
//////        for(intc_event_e e = TIMER_EVENT; e < EVENT_NUM; e++)
//////        {
//////            if(status & (1 << e))
//////            {
//////                if(event_cb[e])
//////                    event_cb[e](status);
//////            }
//////        }
//////    } while(hal_nfc_bit_check(0, 0x7, BIT4, 0));
////}
//
//void intc_irq_handler(void) {
//    if (INT_PIN) {
//        uint32_t status = intc_get_irq_status();
//        for(intc_event_e e = TIMER_EVENT; e < EVENT_NUM; e++) {
//            if(status & (1 << e)) {
//                if(event_cb[e]) {
//                    event_cb[e](status);
//                }
//            }
//        }
//    }
////    do {
////        uint32_t status = intc_get_irq_status();
////        for(intc_event_e e = TIMER_EVENT; e < EVENT_NUM; e++) {
////            if(status & (1 << e)) {
////                if(event_cb[e]) {
////                    event_cb[e](status);
////                }
////            }
////        }
////    } while(hal_nfc_bit_check(0, 0x7, BIT4, 0));
//}



